import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import { Message } from 'element-ui'
const showAlert = (message, type = 'error', duration = 3000) => {
  Message({
    message: message,
    type: type,
    duration: duration,
    showClose: true,
  })
}
const showError = (message, duration = 3000) => {
  showAlert(message, 'error', duration)
}

const showWarning = (message, duration = 3000) => {
  showAlert(message, 'warning', duration)
}
const showSuccess = (message, duration = 3000) => {
  showAlert(message, 'success', duration)
}

const showInfo = (message, duration = 3000) => {
  showAlert(message, 'info', duration)
}





// import { showAlert, showError, showWarning, showSuccess, showInfo } from 'src/utils/message'
//
Vue.prototype.showAlert = showAlert
Vue.prototype.showError = showError
Vue.prototype.showWarning = showWarning
Vue.prototype.showSuccess = showSuccess
Vue.prototype.showInfo = showInfo

Vue.use(ElementUI)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
